import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
    {
    title: '名称',
    dataIndex: 'name'
   },
   {
    title: '面额',
    dataIndex: 'amount'
   },
   {
    title: '满额可用',
    dataIndex: 'orderAmount'
   },
   {
    title: '类型',
    dataIndex: 'type'
   },
   {
    title: '创建时间',
    dataIndex: 'createDate'
   },
   {
    title: '更新时间',
    dataIndex: 'updateDate'
   },
   {
    title: '备注信息',
    dataIndex: 'remarks'
   },
   {
    title: '删除标记',
    dataIndex: 'delFlag'
   },
];

export const searchFormSchema: FormSchema[] = [
 {
    label: '名称',
    field: 'name',
    component: 'Input'
  },
 {
    label: '面额',
    field: 'amount',
    component: 'InputNumber'
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {label: '', field: 'id', component: 'Input', show: false},
  {
    label: '名称',
    field: 'name',
    component: 'Input',
  },
  {
    label: '面额',
    field: 'amount',
    component: 'InputNumber',
  },
  {
    label: '满额可用',
    field: 'orderAmount',
    component: 'InputNumber',
  },
  {
    label: '类型',
    field: 'type',
    component: 'Input',
  },
  {
    label: '创建时间',
    field: 'createDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD hh:mm:ss',
    },
  },
  {
    label: '更新时间',
    field: 'updateDate',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
      valueFormat: 'YYYY-MM-DD hh:mm:ss',
    },
  },
  {
    label: '备注信息',
    field: 'remarks',
    component: 'Input',
  },
  {
    label: '删除标记',
    field: 'delFlag',
    component: 'Input',
  },
];
